package com.yy.wga.mp.module.pay.common.eunms;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: gc
 * @Date: 2021/6/13
 * @Description:
 **/
@Getter
@AllArgsConstructor
public enum EPayChannel {
    /**
     * 支付渠道 微信
     */
    WECHAT(1, "微信支付"),
    ALIPAY(2, "支付宝支付"),
    ;
    private final Integer type;
    private final String desc;

    /**
     * 根据类型获取
     * @param type
     * @return
     */
    public static EPayChannel getByType(Integer type) {
        if (type != null) {
            for (EPayChannel payChannel : EPayChannel.values()) {
                if (payChannel.getType().equals(type)) {
                    return payChannel;
                }
            }
        }
        return null;
    }
}
